/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents;

import GUIComponents.dailyComponents.DailyViewPanel;
import GUIComponents.weeklyComponents.WeeklyViewPanel;
import GUIComponents.monthlyComponents.MonthlyViewPanel;
import GUIComponents.debug.debugPanel;
import MainClasses.CourseManager;

import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
 *
 * @author andrewcutler
 */
public class HWTabbedPane extends JTabbedPane{
    
    
    private DailyViewPanel day;
    private WeeklyViewPanel week;
    private MonthlyViewPanel month;
    private debugPanel debug;
    public HWTabbedPane(CourseManager cm)
    {
        debug = new debugPanel();
        day = new DailyViewPanel(cm);
        week = new WeeklyViewPanel(cm);
        month = new MonthlyViewPanel(cm);
        init();
    }
    public HWTabbedPane(DailyViewPanel day, WeeklyViewPanel week, MonthlyViewPanel month)
    {
        this.debug = new debugPanel();
        this.day = day;
        this.week = week;
        this.month = month;
        init();
    }
    
    private void init()
    {
        this.setBackground(Color.decode("669999"));
        
        //Adds the dailyView
        if(day != null)
            this.add(day, 0);
        if(week != null)
            this.add(week, 1);
        if(month != null)
            this.add(month, 2);
        if(debug != null)
            this.add(debug, 3);
    }
    
    public debugPanel getDebugPanel()
    {
        return debug;
    }
    
    public void resetDailyView()
    {
        day.reset();
    }

    public void resetWeeklyView()
    {
        week.reset();
    }

    private void resetMonthlyView() 
    {
        month.reset();
    }
    
    private void resetDebug()
    {
        debug.update();
    }
    
    public void reset()
    {
        resetDailyView();
        resetWeeklyView();
        resetMonthlyView();
        this.updateUI();
    }
}
